package com.sr.examination.news;

import android.content.Context;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ImageView;
import android.widget.TextView;

import com.squareup.picasso.Picasso;
import com.sr.examination.R;
import com.tl.commonlibrary.tool.UIUtils;
import com.tl.commonlibrary.ui.adapter.IAdapter;
import com.tl.commonlibrary.ui.adapter.ViewHolder;
import com.tl.commonlibrary.ui.beans.NewsBean;

import java.util.List;

/**
 * Created by jiangzhongshan on 18/2/1.
 */

public class NewsAdapter extends IAdapter<NewsBean> {
    public NewsAdapter(Context context, List<NewsBean> datas) {
        super(context, datas, R.layout.item_news);
    }

    @Override
    protected void getView(ViewHolder viewHolder, NewsBean entity, int position, View convertView, boolean isConvert, int itemViewType, ViewGroup parent) {
        TextView titleTView = viewHolder.getView(R.id.titleTView);
        ImageView imgView = viewHolder.getView(R.id.imgView);
        titleTView.setText(entity.getTitle());
        UIUtils.setImage(context, imgView, entity.getPoster());
    }

    @Override
    public void onClick(View v) {

    }
}
